
#include "./server/kv_server.h"

int server(int port, const std::string & host) {
    return lukv::kv_server(port, host).start();
}


int main(int argc, char** argv) {

    int port = 4399;
    std::string host = "127.0.0.1";

    if (argc >= 3) {
        port = std::stoi(argv[1]);
        host = argv[2];
    }

    if (server(port, host) < 0) {
        LOG_ERR(strerror(errno));
    }

    return 0;
}

